package com.mewp.permissions.model.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author mewp
 * @version 1.0
 * @date 2023/7/27 00:58
 */
@Data
public class BaseEntity implements Serializable {
    /**
     * 主键id
     * 已在配置文件中声明id的生成规则：auto
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("开始时间")
    private LocalDateTime createTime;

    @ApiModelProperty("结束时间")
    private LocalDateTime updateTime;

    /**
     * 逻辑删除 默认效果 0 没有删除 1 已经删除
     */
    @ApiModelProperty(value = "删除标记（0:可用 1:已删除）")
    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    @ApiModelProperty(hidden = true)
    @JsonIgnore
    private Map<String, Object> param = new HashMap<>();
}
